forum

Home / DeveloperSection / Forums / Returning partial view from controller

Returning partial view from controller

Sunil Singh141916-Sep-2017

 I want to return studentlist as a partial view. Here is my index method code 

  publicActionResult Index(Student Model)
        {
            using (var ctx = newSchool_Context())
            {
                ctx.Students.Add(Model);
                ViewBag.msg = "Record Saved!!";
                ctx.SaveChanges();
                return PartialView("StudentList");
            }
        }

But I don’t know where the problem is? When I run this code it shows error that view is not found.


Updated on 16-Sep-2017

Can you answer this question?


Answer

1 Answers

Liked By